<page-header> </page-header>
<nz-card>
  <form nz-form [formGroup]="formGroup" (ngSubmit)="onSubmit()" se-container="1">
    <nz-form-item style="display: none">
      <nz-form-label [nzMd]="6" nzRequired nzFor="id">id</nz-form-label>
      <nz-form-control [nzMd]="18" nzErrorTip="The input is not valid id!">
        <input [(ngModel)]="form.model.id" [ngModelOptions]="{ standalone: true }" nz-input name="id" id="id" value="id" />
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="minLength">{{ 'mxk.passwordpolicy.minLength' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="18" [nzMd]="18" [nzXs]="36" [nzXl]="48" nzErrorTip="The input is not validminLength!">
        <nz-input-number
          [(ngModel)]="form.model.minLength"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="minLength"
          id="minLength"
          value="0"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="maxLength">{{ 'mxk.passwordpolicy.maxLength' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid maxLength!">
        <nz-input-number
          [(ngModel)]="form.model.maxLength"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="maxLength"
          id="maxLength"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="lowerCase">{{ 'mxk.passwordpolicy.lowerCase' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid lowerCase!">
        <nz-input-number
          [(ngModel)]="form.model.lowerCase"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="lowerCase"
          id="lowerCase"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="upperCase">{{ 'mxk.passwordpolicy.upperCase' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid upperCase!">
        <nz-input-number
          [(ngModel)]="form.model.upperCase"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="upperCase"
          id="upperCase"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="digits">{{ 'mxk.passwordpolicy.digits' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid digits!">
        <nz-input-number
          [(ngModel)]="form.model.digits"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="digits"
          id="digits"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="specialChar">{{ 'mxk.passwordpolicy.specialChar' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid specialChar!">
        <nz-input-number
          [(ngModel)]="form.model.specialChar"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="specialChar"
          id="specialChar"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="attempts">{{ 'mxk.passwordpolicy.attempts' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid attempts!">
        <nz-input-number
          [(ngModel)]="form.model.attempts"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="attempts"
          id="attempts"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="duration">{{ 'mxk.passwordpolicy.duration' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid duration!">
        <nz-input-group nzAddOnAfter="{{ 'mxk.text.minute' | i18n }}">
          <nz-input-number
            [(ngModel)]="form.model.duration"
            [ngModelOptions]="{ standalone: true }"
            [nzMin]="0"
            [nzMax]="720"
            [nzStep]="1"
            name="duration"
            id="duration"
          ></nz-input-number>
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="occurances">{{ 'mxk.passwordpolicy.occurances' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid occurances!">
        <nz-input-number
          [(ngModel)]="form.model.occurances"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="occurances"
          id="occurances"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="expiration">{{ 'mxk.passwordpolicy.expiration' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid expiration!">
        <nz-input-group nzAddOnAfter="{{ 'mxk.text.day' | i18n }}">
          <nz-input-number
            [(ngModel)]="form.model.expiration"
            [ngModelOptions]="{ standalone: true }"
            [nzMin]="30"
            [nzMax]="365"
            [nzStep]="1"
            name="expiration"
            id="expiration"
          ></nz-input-number>
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="history">{{ 'mxk.passwordpolicy.history' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid history!">
        <nz-input-number
          [(ngModel)]="form.model.history"
          [ngModelOptions]="{ standalone: true }"
          [nzMin]="0"
          [nzMax]="10"
          [nzStep]="1"
          name="history"
          id="history"
        ></nz-input-number>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="username">{{ 'mxk.passwordpolicy.username' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid username!">
        <nz-switch
          [(ngModel)]="form.model.switch_username"
          [ngModelOptions]="{ standalone: true }"
          name="username"
          [nzCheckedChildren]="checkedTemplate"
          [nzUnCheckedChildren]="unCheckedTemplate"
        ></nz-switch>
        <ng-template #checkedTemplate><i nz-icon nzType="check"></i></ng-template>
        <ng-template #unCheckedTemplate><i nz-icon nzType="close"></i></ng-template>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="dictionary">{{ 'mxk.passwordpolicy.dictionary' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid dictionary!">
        <nz-switch
          [(ngModel)]="form.model.switch_dictionary"
          [ngModelOptions]="{ standalone: true }"
          name="dictionary"
          [nzCheckedChildren]="checkedTemplate"
          [nzUnCheckedChildren]="unCheckedTemplate"
        ></nz-switch>
        <ng-template #checkedTemplate><i nz-icon nzType="check"></i></ng-template>
        <ng-template #unCheckedTemplate><i nz-icon nzType="close"></i></ng-template>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="alphabetical">{{ 'mxk.passwordpolicy.alphabetical' | i18n }}</nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid alphabetical!">
        <nz-switch
          [(ngModel)]="form.model.switch_alphabetical"
          [ngModelOptions]="{ standalone: true }"
          name="alphabetical"
          [nzCheckedChildren]="checkedTemplate"
          [nzUnCheckedChildren]="unCheckedTemplate"
        >
        </nz-switch>
        <ng-template #checkedTemplate><i nz-icon nzType="check"></i></ng-template>
        <ng-template #unCheckedTemplate><i nz-icon nzType="close"></i></ng-template>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="numerical">{{ 'mxk.passwordpolicy.numerical' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid numerical!">
        <nz-switch
          [(ngModel)]="form.model.switch_numerical"
          [ngModelOptions]="{ standalone: true }"
          name="numerical"
          [nzCheckedChildren]="checkedTemplate"
          [nzUnCheckedChildren]="unCheckedTemplate"
        ></nz-switch>
        <ng-template #checkedTemplate><i nz-icon nzType="check"></i></ng-template>
        <ng-template #unCheckedTemplate><i nz-icon nzType="close"></i></ng-template>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="qwerty">{{ 'mxk.passwordpolicy.qwerty' | i18n }} </nz-form-label>
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid qwerty!">
        <nz-switch
          [(ngModel)]="form.model.switch_qwerty"
          [ngModelOptions]="{ standalone: true }"
          name="qwerty"
          [nzCheckedChildren]="checkedTemplate"
          [nzUnCheckedChildren]="unCheckedTemplate"
        ></nz-switch>
        <ng-template #checkedTemplate><i nz-icon nzType="check"></i></ng-template>
        <ng-template #unCheckedTemplate><i nz-icon nzType="close"></i></ng-template>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item style="width: 100%">
      <nz-form-control [nzOffset]="7" [nzSpan]="12">
        <button nz-button nzType="primary" type="submit" [nzLoading]="form.submitting">提交</button>
      </nz-form-control>
    </nz-form-item>
  </form>
</nz-card>
